約 2,763,091 件
https://w.atwiki.jp/june1st/pages/13.html
C++BuilderでVCLと共存してGLUTを使う ココのサンプルを参考に プロジェクトに追加で glut32.libと OpenGLのプログラム.c() ← glutInit( _argc, _argv)、glutCreateWindow("sample")、main() → (例えば)GLmain を追加 Project1.cppに USELIB("glut32.libのパス"); USEUNIT("OpenGLのプログラム.c"); Unit1.cpp側で extern "C" int GLmain(void); 外部関数として"OpenGLのプログラム.c"に書かれた関数を呼び出す グローバル変数も外部呼出ししてVCLでいじればおk UbuntuでGLUTを使う とりあえずsynapticでGLUTをインストール(GLUT3〜? gccのオプションに-lglut -lGLU -lGLをつける
https://w.atwiki.jp/usonx/pages/21.html
VC++(MFC)とOpenGL MFCとOpenGLの親和性は高い。逆にMFCとDirectXの親和性は低く、現在のバージョンにおいて、MFC+DirectXの組み合わせは難しい。理由としては、そもそもDirectX自体がMFCを前提としなくなったこと。SampleからMFCtex(MFC+DirectXのサンプル)が消えている。MFCtexがあるバージョンは、DirectX9(2003)のようだが、探した限りではMicrosoft上には見当たらなかった(仮にあったとしてもVC++6のものとなる。VC++2005では、そのままコンパイルできない)。 OpenGLのインストール 1.GLUTのダウンロード 下記サイトから"glut-3.7.6-bin.zip"をダウンロードし、適当なフォルダに解凍する。 http //www.xmission.com/~nate/glut.html 2.ファイルのコピー 解凍したファイルを下記ディレクトリに移動する。フォルダ名は環境によって若干異なる。.hは、GLフォルダを作りその中に入れること。 glut.h → C \Program Files\Microsoft Visual Studio\VC98\Include\GL .lib → C \Program Files\Microsoft Visual Studio\VC98\Lib .dll → C \WINDOWS\SYSTEM32 MFC(ダイアログベース)+OpenGL プロジェクト名をhogeとすると、 1.ヘッダファイルの記述 クラスChogeDlgに以下includeを追加 \#include GL/glaux.h 2.メンバ変数の追加 クラスChogeDlgに以下変数を追加する CDC* m_pDC; HGLRC m_GLRC; 3.メンバ関数の追加 int ChogeDlg SetDCPixelFormat(HDC hdc) { static PIXELFORMATDESCRIPTOR pfd = { sizeof (PIXELFORMATDESCRIPTOR),// Size of this structure 1,// Version number PFD_DRAW_TO_WINDOW |// Flags PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, PFD_TYPE_RGBA,// RGBA pixel values 24,// 24-bit color 0, 0, 0, 0, 0, 0,// Don t care about these 0, 0,// No alpha buffer 0, 0, 0, 0, 0,// No accumulation buffer 32,// 32-bit depth buffer 0,// No stencil buffer 0,// No auxiliary buffers PFD_MAIN_PLANE,// Layer type 0,// Reserved (must be 0) 0, 0, 0// No layer masks }; int nPixelFormat; nPixelFormat = ChoosePixelFormat (hdc, pfd); if (SetPixelFormat(hdc, nPixelFormat, pfd) == FALSE){ // SetPixelFormat error return FALSE ; } if (DescribePixelFormat(hdc, nPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), pfd) == 0) { // DescribePixelFormat error return FALSE ; } if (pfd.dwFlags PFD_NEED_PALETTE) { // Need palete ! } return TRUE ; } void ChogeDlg InitGL() { m_pDC = new CClientDC(this); // Get device context SetDCPixelFormat(m_pDC- m_hDC); // Set OpenGL pixel format m_GLRC = wglCreateContext (m_pDC- m_hDC); // Create rendering context wglMakeCurrent (m_pDC- m_hDC, m_GLRC); // Current context set glClearColor(0.0f, 0.0f, 0.5f, 1.0f); } void ChogeDlg DrawGL() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ; } BOOL ChogeDlg OnInitDialog() の return TRUE; の上に InitGL(); を追加する. ClassView@ChogeDlg→メッセージ で WM_DESTROY をダブルクリックし, OnDestroy を呼ぶ. void ChogeDlg OnDestroy() { CView OnDestroy(); // TODO この位置にメッセージ ハンドラ用のコードを追加してください wglMakeCurrent(NULL, NULL); // free current context wglDeleteContext(m_GLRC); // Delete rendering context delete m_pDC; // Release device context } OnPaint に以下の文を追加. void COpenGLTest2Dlg OnPaint() { if (IsIconic()) { CPaintDC dc(this); // 描画用のデバイス コンテキスト SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // クライアントの矩形領域内の中央 int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect( rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // アイコンを描画します。 dc.DrawIcon(x, y, m_hIcon); } else { CDialog OnPaint(); DrawGL(); //これを追加 SwapBuffers(m_pDC- m_hDC); //これを追加 } } Pictureコントロール上に描画するには、 ダイアログにピクチャボックスを設置する.(大きさは適当) ID→ID_PICT に書き換え,クラスウィザードで ID_PICT の変数を追加する. コントロールID タイプ メンバ IDC_PICT CStatic m_Pict InitGL() に一文を追加する. void COpenGLTest2Dlg InitGL() { m_pDC = new CClientDC(this); m_pDC- m_hDC = m_Pict.GetDC()- GetSafeHdc(); //これを追加 SetDCPixelFormat(m_pDC- m_hDC); m_GLRC = wglCreateContext (m_pDC- m_hDC); wglMakeCurrent (m_pDC- m_hDC, m_GLRC); glClearColor(0.0f, 0.0f, 0.5f, 1.0f); }
https://w.atwiki.jp/sevenlives/pages/2256.html
GLUT OpenGL ES GLSL? WebGL OpenCL? シリコングラフィックス?
https://w.atwiki.jp/opengles/pages/24.html
Open GL ES commands are formed from a return type, a name, and optionally a type letter i for 32-bit int, or f for 32-bit float, as shown by the prototype below return-type Name{1234}{if}{v} ([args ,] T arg1 , . . . , T argN [, args]); The arguments enclosed in brackets ([args ,] and [, args]) may or may not be present. The argument type T and the number N of arguments may be indicated by the command name suffixes. N is 1, 2, 3, or 4 if present, or else corresponds to the type letters. If “v” is present, an array of N items is passed by a pointer. For brevity, the OpenGL documentation and this reference may omit the standard prefixes. The actual names are of the forms glFunctionName(), GL_CONSTANT, GLtype
https://w.atwiki.jp/slab/pages/14.html
開発環境の構築(Windows) 下記サイトを参照。 VisualC++ を使った OpenGL 入門【0.1日目】OpenGL と Visual C++ 2008 Express Edition の準備 まずはVisual Studio 2010をインストールする。(Visual C++ 2010 Express EditionでもOK。Visual C++ 2010 Express Editionは無料。) GLUTのダウンロードサイトの一番上にある「glut-3.7.6-bin.zip (117 KB)」をダウンロードする。 Windows7でVisual Studio 2010を使って開発する場合は、解凍したzipに入っている3つのファイルを以下のように配置する。 ファイル名 設置場所 glut32.dll C \Windows\SysWOW64 glut32.lib C \Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib glut.h C \Program Files (x86)\Microsoft Visual Studio 10.0\VC\include Visual Studio 2010でプロジェクトを作成する際に、プロジェクトの種類を「CLR」にして開発をする。
https://w.atwiki.jp/risc2010/pages/20.html
OpenGL ここを編集
https://w.atwiki.jp/nkym_memo/pages/60.html
OpenGL
https://w.atwiki.jp/zukunashi-yarou/pages/22.html
OpenGL
https://w.atwiki.jp/www2www/pages/11.html
openglについての何か GL_ARB_texture_non_power_of_two
https://w.atwiki.jp/shiitakeo/pages/25.html
@Mac ヘッダファイルのインクルード Winでは #include GL/glut.h だけど,Macだと #include GLUT/glut.h にする. コンパイルするとき. frameworkを指定してやる.GLUT使うならそれも. $gcc -framework OpenGL -framework GLUT prg.c *